home *** CD-ROM | disk | FTP | other *** search
- Path: csus.edu!news
- From: wleong@sfsu.edu (Jerry Leong)
- Newsgroups: comp.lang.c
- Subject: macro that return value, how?
- Date: Wed, 28 Feb 1996 05:35:35 GMT
- Organization: San Francisco State University
- Message-ID: <3133e87b.868433@news.csus.edu>
- NNTP-Posting-Host: wleong@pluto.sfsu.edu
- X-Newsreader: Forte Agent .99d/32.182
-
-
- Hi,
- I need to define a macro that will first calculate a given a
- parameter and then return it. How can I do that?
-
- p/s: Say I pass a value to the macro, macro will perform some
- addition, then return the value.
-
- #define add1(x) { x+=VAR; return x; }
-
- something like that by the above does not compile.
- Thanx in advance!
-